package com.loukou.lkt.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.loukou.lkt.lkt.req.SaleOrderReq;
import com.loukou.lkt.lkt.req.SaleOrderReturnDto;
import com.loukou.lkt.lkt.resp.RespDto;
import com.loukou.lkt.lkt.service.SaleOrderService;

@Controller
@RequestMapping("/api/saleOrder")
public class SaleOrderController {
	
	@Autowired
	private SaleOrderService saleOrderService;
	
	@RequestMapping(value="receiveSaleOrder", method=RequestMethod.POST)
	@ResponseBody
	public RespDto<String> receiveSaleOrder(@RequestBody SaleOrderReq req){
		return saleOrderService.receiveSaleOrder(req);
	}
	
	@RequestMapping(value="receiveSaleOrderReturn", method=RequestMethod.POST)
	@ResponseBody
	public RespDto<String> receiveSaleOrderReturn(@RequestBody SaleOrderReturnDto req){
		RespDto<String> resp = new RespDto<String>();
		resp = saleOrderService.receiveSaleOrderReturn(req);
		return resp;
	}

}
